<% layout('/layouts/default.html', {title: 'school管理', libs: ['validate','fileupload']}){ %>
<div class="main-content" xmlns:>
	<div class="box box-main">
		<div class="box-header with-border">
			<div class="box-title">
				<i class="fa fa-list-alt"></i> ${text(school.isNewRecord ? '新增学校' : '编辑学校')}
			</div>
			<div class="box-tools pull-right">
				<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
			</div>
		</div>
		<#form:form id="inputForm" model="${school}" action="${ctx}/school/school/save" method="post" class="form-horizontal">
			<div class="box-body">
				<div class="form-unit">${text('基本信息')}</div>
				<#form:hidden path="id"/>
				<input type="hidden" id="getProvince" value="${school.province}">
				<input type="hidden" id="getCity" value="${school.city}">
				<input type="hidden" id="getCounty" value="${school.county}">

				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required ">*</span> ${text('名称')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="name" maxlength="255" class="form-control required"/>
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required ">*</span> ${text('省市区/县')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-2" style="float: left">
								<#form:select id="s_province" path="province"  class="form-control required"  />
							</div>
							<div class="col-sm-2" style="float: left">
								<#form:select id="s_city" path="city"  class="form-control required"  />
							</div>
							<div class="col-sm-2">
								<#form:select id="s_county" path="county"  class="form-control required"  />
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<!--<div class="col-xs-6">-->
						<!--<div class="form-group">-->
							<!--<label class="control-label col-sm-4" title="">-->
								<!--<span class="required ">*</span> ${text('市')}：<i class="fa icon-question hide"></i></label>-->
							<!--<div class="col-sm-8">-->
								<!--<#form:input path="city" maxlength="10" class="form-control required"/>-->
							<!--</div>-->
						<!--</div>-->
					<!--</div>-->
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required ">*</span> ${text('省市后的具体区域')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="area" maxlength="255" class="form-control required"/>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required ">*</span> ${text('星级')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="level" maxlength="2" class="form-control required digits"/>
							</div>
						</div>
					</div>

					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								 ${text('日常监督机构')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="supervisor" maxlength="30" class="form-control "/>
							</div>
						</div>
					</div>

				</div>
				<!--<div class="row">-->
					<!--<div class="col-xs-12">-->
						<!--<div class="form-group">-->
							<!--<label class="control-label col-sm-2" title="">-->
								<!--<span class="required hide">*</span> ${text('备注信息')}：<i class="fa icon-question hide"></i></label>-->
							<!--<div class="col-sm-10">-->
								<!--<#form:textarea path="remarks" rows="4" maxlength="500" class="form-control"/>-->
							<!--</div>-->
						<!--</div>-->
					<!--</div>-->
				<!--</div>-->
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2">${text('学校图片')}：</label>
							<div class="col-sm-10">
								<#form:fileupload id="uploadImage" returnPath="true" bizKey="${school.id}" bizType="pictureUrl" maxUploadNum="1"
									uploadType="image" class="" readonly="false"/>
							</div>
						</div>
					</div>
				</div>

				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								 ${text('法人代表')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="owner" maxlength="20" class="form-control "/>
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								 ${text('经营项目')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="content" maxlength="10" class="form-control required"/>
							</div>
						</div>
					</div>
				</div>

				<!--<div class="row">-->
				<!---->
				<!--</div>-->

				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('发证日期')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="cardStartDate" readonly="true" maxlength="20" class="form-control Wdate"
										dataFormat="datetime" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',isShowClear:true});"/>
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('有效期至')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="cardEndDate" readonly="true" maxlength="20" class="form-control Wdate"
										dataFormat="datetime" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',isShowClear:true});"/>
							</div>
						</div>
					</div>
				</div>

				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								${text('开门时间')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input  path="startTime" readonly="true" maxlength="20" class="form-control Wdate"
										dataFormat="datetime" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',isShowClear:true});"/>
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								${text('关门时间')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input  path="endTime" readonly="true" maxlength="20" class="form-control Wdate"
										dataFormat="datetime" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',isShowClear:false});"/>
							</div>
						</div>
					</div>
				</div>

				<div class="row">

					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								开门类型：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:select path="openType" dictType="com_open_type" blankOption="true" class="form-control" />
							</div>
						</div>
					</div>
				</div>

				<div class="form-unit">${text('资质')}</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2">${text('资质证明')}：</label>
							<div class="col-sm-10">
								<#form:fileupload id="uploadImage1" returnPath="true" bizKey="${school.id}" bizType="qualification" maxUploadNum="10"
										uploadType="image" class="" readonly="false"/>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2">${text('人员健康证')}：</label>
							<div class="col-sm-10">
								<#form:fileupload id="uploadImage5" returnPath="true" bizKey="${school.id}" bizType="healthCard" maxUploadNum="30"
										uploadType="image" class="" readonly="false"/>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2">${text('食安管理员')}：</label>
							<div class="col-sm-10">
								<#form:fileupload id="uploadImage2" returnPath="true" bizKey="${school.id}" bizType="manager" maxUploadNum="10"
										uploadType="image" class="" readonly="false"/>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2">${text('食安承诺书')}：</label>
							<div class="col-sm-10">
								<#form:fileupload id="uploadImage3" returnPath="true" bizKey="${school.id}" bizType="promise" maxUploadNum="1"
										uploadType="image" class="" readonly="false"/>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2">${text('供应来源')}：</label>
							<div class="col-sm-10">
								<#form:fileupload id="uploadImage4" returnPath="true" bizKey="${school.id}" bizType="source" maxUploadNum="10"
										uploadType="image" class="" readonly="false"/>
							</div>
						</div>
					</div>
				</div>

			</div>
			<div class="box-footer">
				<div class="row">
					<div class="col-sm-offset-2 col-sm-10">
						<% if (hasPermi('school:school:edit')){ %>
							<button type="submit" class="btn btn-sm btn-primary" id="btnSubmit"><i class="fa fa-check"></i> ${text('保 存')}</button>&nbsp;
						<% } %>
						<button type="button" class="btn btn-sm btn-default" id="btnCancel" onclick="js.closeCurrentTabPage()"><i class="fa fa-reply-all"></i> ${text('关 闭')}</button>
					</div>
				</div>
			</div>
		</#form:form>
	</div>
</div>
<% } %>
<script>
$("#inputForm").validate({
	submitHandler: function(form){
		js.ajaxSubmitForm($(form), function(data){
			js.showMessage(data.message);
			if(data.result == Global.TRUE){
				js.closeCurrentTabPage(function(contentWindow){
					contentWindow.page();
				});
			}
		}, "json");
    }
});
</script>
<script type="text/javascript" src="/../fms/js/common/province.js"></script>
<script>
	_selected_area([$("#getProvince").val(),$("#getCity").val(),$("#getCounty").val()]);
</script>
